Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JavaScript error with min/max value set in DateTime #258

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

ifurnadjiev
Copy link
Contributor

One a date filed (year, month or day) is changed with min/max limit set, DateTime.js#_applyLimitRestriction is called to ensure that the new date in not outside the range. If you set all three fields together, using _setDate, the intermidiate validation (after every filed) can lead to endless recursion.

Avoid calling DateTime.js#_applyLimitRestriction before all the three fields are set.

Fix: #253

@ifurnadjiev ifurnadjiev requested a review from mknauer December 16, 2024 08:24
Once a date field (year, month or day) is changed with min/max limit set,
DateTime.js#_applyLimitRestriction is called to ensure that the new date
is not outside the range. If you set all three fields together, using
_setDate, the intermidiate validation (after every field) can lead to
endless recursion.

Avoid calling DateTime.js#_applyLimitRestriction before all the three
fields are set.

Fix: #253
@ifurnadjiev ifurnadjiev merged commit 42a07c0 into main Jan 8, 2025
1 of 2 checks passed
@ifurnadjiev ifurnadjiev deleted the issue-253 branch January 8, 2025 15:05
@mknauer mknauer added the bug Something isn't working label Jan 8, 2025
@mknauer mknauer added this to the 4.2 milestone Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants